﻿using System;
using System.Collections.Generic;
using System.Web;

namespace NFinal.Compile
{
    //单独生成
    public class AutoCompleteCompiler
    {
        public string fileName;
        public AutoCompleteCompiler(string fileName)
        {
            this.fileName = fileName;
        }
        public void Compile(MethodData methodData, List<ViewData> viewDatas, Config config)
        {
            ViewData viewData = null;
            for (int i = 0; i < viewDatas.Count; i++)
            { 
                viewData = viewDatas[i];
                bool IsVarName = false;
                //获取模板样式变量或字符串
                if (string.IsNullOrEmpty(viewData.templateStyle))
                {
                    //此处当字符串来算.
                    IsVarName = false;
                    viewData.templateStyle = "\"" + config.defaultStyle.Trim('/') + "\"";
                }
                else
                {
                    if (viewData.templateStyle.IndexOf('\"') > -1)
                    {
                        IsVarName = false;
                    }
                    else
                    {
                        IsVarName = true;
                    }
                }

            }
        }
    }
}